// @ts-ignore
import template from './template.raw.html';
// @ts-ignore
import style from './template.raw.scss';

class ExtensionHelper extends HTMLElement {

    shadow

    constructor() {
        super();
        this.shadow = this.attachShadow({mode: 'open'});
        this.shadow.innerHTML = template
        const styleSheet = new CSSStyleSheet()
        styleSheet.replaceSync(style)
        this.shadow.adoptedStyleSheets = [styleSheet];

        this.shadow.querySelector('.componet-a')?.addEventListener?.('click', function () {
            window.EcExtension.popup({
                title: 'test',
                view: 'tt'
            })
        })
    }
}

customElements.define("e9-form-extension-helper", ExtensionHelper);